#! /usr/bin/python

import math
import time

now = time.time()

UPPER = 12000 +1
N = [0]*12001
for k in range(2, UPPER):
    N[k] = 2*k

for i in range(2, UPPER):
  p = i
  s = i
  length = 2
  for l in range(2, UPPER):
    p *= l
    s += l
    if p >= 2*UPPER-2: break
    k = length + p - s
    if k>=UPPER: break
    if N[k] > p: N[k] = p
    length += 1
    for j in range(2, UPPER):   
        n = p * j
	k = length + n - (p + j)
	if n > 2*UPPER-2 or k>=UPPER: break	
	if N[k] > n: N[k] = n

SN = set(N)
print sum(SN)
print len(SN)
print N[2], N[3], N[4], N[5], N[6], N[7], N[8]
print time.time()-now
